<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取授权码页面</title>
</head>
<body>
<h1>获取授权码页面</h1>
<form action="/oauth" id="form">
    <input type="hidden" id="code" name="code"/>
    <input type="submit" value="点击">
</form>
<script type="text/javascript">
    window.onload = function () {
        function UrlSearch() {
            let str = location.href;  //取得整个地址栏
            let num = str.indexOf("?");
            str = str.substr(num + 1); //str得到?之后的字符串
            let arr = str.split("=")
            let input = document.getElementById("code");
            input.value = arr[1]
        }
        UrlSearch()
    }
</script>
</body>
</html>